# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=go-websocket
_pkgname=websocket
_vendor=gorilla
pkgver=1.4.0
pkgrel=5
pkgdesc="A WebSocket implementation for Go"
url="https://www.gorillatoolkit.org/"
arch="noarch"
license="BSD-2-Clause"
depends="go"
subpackages="$pkgname-doc"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/$_vendor/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

package() {
	mkdir -p "$pkgdir"/usr/share/doc/$_vendor/$pkgname \
		"$pkgdir"/usr/lib/go/src/github.com/$_vendor/$_pkgname
	for file in \
		LICENSE \
		README.* \
		COPYRIGHT \
		AUTHORS \
		examples \
		; do \
		test -e $file && mv $file "$pkgdir"/usr/share/doc/$_vendor/$pkgname
	done
	mv -- * "$pkgdir"/usr/lib/go/src/github.com/$_vendor/$_pkgname
}

sha512sums="
c358358d8c081e32eb06bde901c1d060de7ca08c2a60541dc06f70936a94de3d6a8ae26dd86ebceeeef6c2b75f9c79a0c4a1f8fc6ee84f5ed7ec9fe6f9c7dee4  go-websocket-1.4.0.tar.gz
"
